{% extends "root/templates/base.html" %}

{% block content %}
<h2>{{ fieldset.verbose_name }}</h2>

<div class="info">
  <strong>This field set contains the following fields:</strong><br />
  {% for field in fieldset.fields_list %}
    {{ field.verbose_name }} (<i>{{ field.verbose_type }}</i>)
    {% if not forloop.last %}
      &nbsp;&nbsp;|&nbsp;&nbsp; 
    {% endif %}
  {% endfor %}
  <br /><br />
  <strong>Total number of entries for this fieldset:</strong> {{ fieldset.count }}
</div>

<form method="POST" action="/query/all">
Download data for all people with this Field Set<br />
{% if tags %}
You can also filter on the following keywords:<br />
  {% regroup tags by verbose_property as grouped %}
  {% for group in grouped %}
    <fieldset>
      <legend>{{ group.grouper }}</legend>
      {% for tag in group.list %}
        <input type="checkbox" name="filter" value="{{ tag.key }}" />
        {{ tag.verbose_value|capfirst }}
        ({{ tag.count }} occurrences)<br />
      {% endfor %}  
    </fieldset>
  {% endfor %}
{% endif %}
<input type="hidden" name="fieldset" value={{ fieldset.key }} />
<input type="submit" value="Download Data" /> 
</form>

{% endblock %}
